<?php

use app\index\controller\User;
use app\index\controller\Utils;
use app\middleware\AuthMiddleware;
use think\facade\Route;

Route::miss(function () {
    return '404 Not Found!';
});
Route::group(function () {
    Route::post('/upload/file', [Utils::class, 'file']);//上传文件
    Route::post('/user/login', [User::class, 'login']);//微信登录
    Route::get('/user/authorize', [User::class, 'authorize']);//公众号授权

    Route::get('/jwt',function (){
       //$token=\think\admin\extend\JwtExtend::token(['id'=>100]);
       ////eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTI4Mjk1NTUsImVuYyI6ImV5SnBkaUk2SW05NWFtWjZjbnBuWW1nMlptUTVNWElpTENKMllXeDFaU0k2SWs1Q2VIbzNZamhoYzJaSVpYbFhWM1lyWkdoS2RUQkZNRXd5UjAwNVZXeFhZMEp1YkVGNFNucGNMM2hEV0dGdk1ERk5aVlo1V1VkWmFITlBibVUzT0hOaFdFTlhkSGRZTnpCeksyRmxRalpOVWpKNWRqbGNMMmM5UFNKOSJ9.l1_IVYSuvj8s_fq-TeonmGzRj-S5_PNgZhKgWM_XOXE
       //$ret= \think\admin\extend\JwtExtend::verify($token);
       //return json($ret);
       ////return json(['code'=>200,'token'=>$token]);
    });
});

Route::group(function () {
    Route::post('/user/mobile', [User::class, 'mobile']);//手机号码
    Route::post('/user/save', [User::class, 'save']);//更新个人信息
    Route::get('/user/info', [User::class, 'info']);//个人信息
})->middleware(AuthMiddleware::class);


